<template>
	<div>
		<div>列表</div>
		<div>
			<a-tree
				:show-line="showLine"
				:show-icon="showIcon"
				:default-expanded-keys="['0-0-0', '0-0-1', '0-0-2']"
				@select="onSelect"
			>
				<template #icon><carry-out-outlined /></template>
				<a-tree-node key="0-0">
					<template #icon><carry-out-outlined /></template>
					<template #title
						><span style="color: #1890ff">parent 1</span></template
					>
					<a-tree-node title="parent 1-0" key="0-0-0">
						<template #icon><carry-out-outlined /></template>
						<a-tree-node title="leaf" key="0-0-0-0">
							<template #icon><carry-out-outlined /></template>
						</a-tree-node>
						<a-tree-node title="leaf" key="0-0-0-1">
							<template #icon><carry-out-outlined /></template>
						</a-tree-node>
						<a-tree-node title="leaf" key="0-0-0-2">
							<template #icon><carry-out-outlined /></template>
						</a-tree-node>
					</a-tree-node>
					<a-tree-node title="parent 1-1" key="0-0-1">
						<template #icon><carry-out-outlined /></template>
						<a-tree-node title="leaf" key="0-0-1-0">
							<template #icon><carry-out-outlined /></template>
						</a-tree-node>
					</a-tree-node>
					<a-tree-node title="parent 1-2" key="0-0-2">
						<template #icon><carry-out-outlined /></template>
						<a-tree-node title="leaf" key="0-0-2-0">
							<template #icon><carry-out-outlined /></template>
						</a-tree-node>
						<a-tree-node title="leaf" key="0-0-2-1">
							<template #icon><carry-out-outlined /></template>
							<template #switcherIcon><form-outlined /></template>
						</a-tree-node>
					</a-tree-node>
				</a-tree-node>
			</a-tree>
		</div>
	</div>
</template>

<script>
export default {
	props: {},
	computed: {},
	components: {},
	data() {
		return {
			isLang: false,
		}
	},
	created() {
		this.init()
		// 获取列表
	},
	mounted() {
		// 语言切换监听
		let that = this
		window.addEventListener('setItemEvent', function (e) {
			console.log(e)
			if (e.key === 'lang') {
				that.lang = JSON.parse(e.value)
				if (that.lang == 'zh-EN') {
					// that.tx(1);
					that.filterSearchInputOptionEn()
					that.isLang = false
				} else {
					// that.tx();
					that.handleSearch()
					that.isLang = true
				}
			}
		})
	},
	methods: {
		init() {},
	},
}
</script>

<style lang="less" scoped></style>
